import { pubRequire } from '@utils/public'
const baseUrl = '/live-rooms/messages'
/*直播间快捷消息列表*/
export function getMessageList(obj, callbBack, errBack) {
  return pubRequire('get', `${baseUrl}`, obj, callbBack, errBack)
}
/* 获取排课管理课程 */
export function getCourseList(obj, callbBack, errBack) {
  return pubRequire('get', '/courses/lists', obj, callbBack, errBack)
}
/* 获取橱窗体验课课程 */
export function getWindowCourses(obj, callbBack, errBack) {
  return pubRequire('get', '/courses/window', obj, callbBack, errBack)
}
/* 获取已关联快捷消息的所有课程 */
export function getRelatedCourses(obj, callbBack, errBack) {
  return pubRequire('get', `${baseUrl}/courses`, obj, callbBack, errBack)
}
/* 新增快捷消息 */
export function addMessage(obj, callbBack, errBack) {
  return pubRequire('post', `${baseUrl}`, obj, callbBack, errBack)
}
/* 修改快捷消息 */
export function updataMessage(obj, callbBack, errBack) {
  return pubRequire('put', `${baseUrl}/${obj.id}`, obj, callbBack, errBack)
}
/* 获取消息关联的课程 */
export function getMessageCourseDetail(obj, callbBack, errBack) {
  return pubRequire(
    'get',
    `${baseUrl}/${obj.id}/courses`,
    obj,
    callbBack,
    errBack
  )
}
/* 获取快捷消息详情 */
export function getMessageDetail(obj, callbBack, errBack) {
  return pubRequire('get', `${baseUrl}/${obj.id}`, obj, callbBack, errBack)
}
/* 快捷消息启用 */
export function messageOpen(obj, callbBack, errBack) {
  return pubRequire(
    'patch',
    `${baseUrl}/${obj}/enabled`,
    obj,
    callbBack,
    errBack
  )
}
/* 快捷消息禁用 */
export function messageOff(obj, callbBack, errBack) {
  return pubRequire(
    'patch',
    `${baseUrl}/${obj}/disabled`,
    obj,
    callbBack,
    errBack
  )
}
/* 删除快捷消息 */
export function messageDelete(obj, callbBack, errBack) {
  return pubRequire('delete', `${baseUrl}/${obj}`, obj, callbBack, errBack)
}
